package com.fuershiye.woman.monitor.service;

import com.fuershiye.woman.monitor.beans.Result;
import com.fuershiye.woman.monitor.beans.ViewReportAllValue;

import java.util.List;
import java.util.Map;

/**
 * @author yongyongdong
 *
 * Report 上报数据存储在 depart_indicator 中，页面显示一般需要depart、indicator、和上报数据三部分组成
 *
 * 通过此类将数据整合，control 调用组合数据时使用此类中的方法
 *
 */
public interface ReportService {

    Result saveReport(Long id, Integer year, Integer type, Double value, String editor, String remark);

    /**
     * 标准方法
     * year 必须合法
     *
     * @param departIds
     * @param forms
     * @param indicators
     * @param years
     * @param status
     * @return
     */
    List<ViewReportAllValue> getReportDate(List<Long> departIds, Long forms, List<Long> indicators, List<Integer> years, Integer status);


    /**
     * 合并多年的数据，以firstList为准
     *
     * yearResult, lastResult
     *
     * @param firstList this year Result
     * @param secondList last year Result
     * @param year
     * @return
     */
    List<Map<String, Object>> merge(List<Map<String, Object>> firstList, List<Map<String, Object>> secondList, Integer year);
    /**
     * 将年份数据属性改为，年份和数值
     * @param listVrv
     * @param years
     * @return
     */
    List<Map<String, Object>> filter(List<ViewReportAllValue> listVrv, List<Integer> years);
    /**
     * 将年份数据属性改为，年份和数值
     * @param listVrv
     * @param years
     * @return
     */
    List<Map<String, Object>> filter(List<ViewReportAllValue> listVrv, List<Integer> years, List<Long> departIds);

    /**
     * 按照指标维度，获取同一指标、所有部门的数据
     * @param list
     * @return key为指标ID
     */
    Map<String, List<ViewReportAllValue>> filter(List<ViewReportAllValue> list);
    /**
     * 按照指标维度，获取同一指标、合并不部门数据为一条
     * @param list
     * @return
     */
    List<Map<String, Object>> axis(Map<String, List<ViewReportAllValue>> list, Integer year);


    List<ViewReportAllValue> appendPidName(List<ViewReportAllValue> list);

//
//    List<ViewReportAllValue> getReportDate(List<Long> departIds, Long forms, List<Long> indicators, List<Integer> years, Integer status);
//    List<ViewReportAllValue> listInCondition(Long areaid, Integer country, List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer province, List<Integer> years, Integer status, Page page);
//    List<ViewReportAllValue> listInDepartIds(Long areaid, List<Long> departIds, Long forms, List<Integer> years, Integer status, Page page);
//    List<ViewReportAllValue> listInIndicators(Integer country, Long forms, String iname, List<Long> indicators, Integer province, List<Integer> years, Integer status, Page page);
//
//    int countInCondition(Long areaid, Integer country, List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer province, List<Integer> years);
//    int countInDepartIds(Long areaid, List<Long> departIds, Long forms, List<Integer> years, Integer status);
//    int countInIndicators(Integer country, Long forms, String iname, List<Long> indicators, Integer province, List<Integer> years, Integer status);
//
//
//    List<ViewReportAllValue> listInCondition(Long areaid, List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer status, Page page);
//    List<ViewReportAllValue> listInCondition(Long areaid, List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer province, Integer status, Page page);
//    List<ViewReportAllValue> listInCondition(Long areaid, Long forms, String iname, List<Long> indicators, Integer province, Integer status, Page page);
//    List<ViewReportAllValue> listInCondition(Long departId, Long forms, String iname, Integer status, Page page);
//    List<ViewReportAllValue> listInCondition(Long departId, Long forms, String iname, Integer province, Integer status, Page page);
//    List<ViewReportAllValue> listInCondition(List<Long> departIds, Long forms, Long indicator, Integer status);
//    List<ViewReportAllValue> listInCondition(List<Long> departIds, Long forms, List<Long> indicators, Integer status);
//    List<ViewReportAllValue> listInCondition(List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer status, Page page);
//    List<ViewReportAllValue> listInCondition(List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer province, Integer status, Page page);
//    List<ViewReportAllValue> listInCondition(Integer country, Long forms, Integer status, Page page);
//
//    int countInCondition(Long areaid, List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer province, Integer status);
//    int countInCondition(Integer country, Long forms, Integer status);
//    int countInCondition(Integer status);
//    int countInCondition(Long departId, Long forms, String iname, Integer status);
//    int countInCondition(Long departId, Long forms, String iname, Integer province, Integer status);
//    int countInCondition(List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer status);
//    int countInCondition(List<Long> departIds, Long forms, String iname, List<Long> indicators, Integer province, Integer status);

}
